import type { RouteRecordRaw } from "vue-router";
/**
 * 路由meta对象参数说明
 * meta: {
 *      title:          菜单栏及 tagsView 栏、菜单搜索名称（国际化）
 *      hidden：        是否隐藏此路由
 *      icon：          菜单、tagsView 图标，阿里：加 `iconfont xxx`，fontawesome：加 `fa xxx`
 *      isHideHeader: true,  是否隐藏头部组件
 * }
 */

/**
 * 静态路由（默认路由）
 */
export const staticRoutes: Array<RouteRecordRaw> = [
  {
    path: "/",
    component: () => import("@/views/home/index.vue"),
    redirect: "/home",
    children: [
      {
        path: "home",
        name: "Home",
        component: () => import("@/views/home/index.vue"),
        meta: {
          title: "首页",
          // icon: "ele-HomeFilled",
        },
      },
    ],
  },
  {
    path: "/login",
    name: "Login",
    component: () => import("@/views/login/index.vue"),
    meta: {
      hidden: true,
      isHideHeader: true, //是否隐藏头部组件
    },
  },
  {
    path: "/paysuccess",
    name: "Paysuccess",
    component: () => import("@/views/paysuccess/index.vue"),
    meta: {
      hidden: true,
      title: "支付完成",
    },
  },
  {
    path: "/trade",
    name: "Trade",
    component: () => import("@/views/trade/index.vue"),
    meta: {
      hidden: true,
      title: "支付订单",
    },
  },
  {
    path: "/pay",
    name: "Pay",
    component: () => import("@/views/pay/index.vue"),
    meta: {
      hidden: true,
      title: "支付",
    },
  },
  {
    path: "/register",
    name: "Register",
    component: () => import("@/views/register/index.vue"),
    meta: {
      title: "天猫注册",
      isHideFooter: true,
    },
  },
  {
    path: "/collect",
    name: "Collect",
    component: () => import("@/views/collect/index.vue"),
    meta: {
      title: "收藏夹",
    },
  },

  {
    path: "/detail",
    name: "ShopDetail",
    component: () => import("@/views/detail/index.vue"),
    meta: {
      title: "详情页",
      // icon: "ele-HomeFilled",
    },
  },
  {
    path: "/shopcart",
    name: "ShopCart",
    component: () => import("@/views/shopcart/index.vue"),
    meta: {
      title: "购物车",
    },
  },
  {
    path: "/order",
    name: "Order",
    component: () => import("@/views/order/index.vue"),
    meta: {
      title: "订单",
    },
  },
  {
    path: "/404",
    name: "404",
    component: () => import("@/views/error/404.vue"),
    meta: {
      hidden: true,
    },
  },
  {
    path: "/search",
    name: "Search",
    component: () => import("@/views/search/index.vue"),
    meta: {
      title: "搜索页面",
      // icon: "ele-HomeFilled",
    },
  },
  // 匹配任意路由
  {
    path: "/:pathMatch(.*)",
    name: "Any",
    redirect: "/404",
    meta: {
      hidden: true,
    },
  },
];
